<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="ElementoCreateDlg" widgetVar="ElementoCreateDialog" modal="true" resizable="false" appendToBody="true" header="#{myBundle.CreateElementoTitle}" closeOnEscape="true">

            <h:form id="ElementoCreateForm">

                <h:panelGroup id="display">
                    <p:panelGrid columns="2">

                        <p:outputLabel value="#{myBundle.CreateElementoLabel_idELEMENTO}" for="idELEMENTO" />
                        <p:inputText id="idELEMENTO" value="#{elementoController.selected.idELEMENTO}" title="#{myBundle.CreateElementoTitle_idELEMENTO}" required="true" requiredMessage="#{myBundle.CreateElementoRequiredMessage_idELEMENTO}"/>

                        <p:outputLabel value="#{myBundle.CreateElementoLabel_disponibilita}" for="disponibilita" />
                        <p:inputText id="disponibilita" value="#{elementoController.selected.disponibilita}" title="#{myBundle.CreateElementoTitle_disponibilita}" required="true" requiredMessage="#{myBundle.CreateElementoRequiredMessage_disponibilita}"/>

                        <p:outputLabel value="#{myBundle.CreateElementoLabel_escursione}" for="escursione" />
                        <p:selectOneMenu id="escursione" value="#{elementoController.selected.escursione}"  converter="escursioneConverter">
                            <f:selectItem itemLabel="#{myBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{escursioneController.items}"
                                           var="escursioneItem"
                                           itemValue="#{escursioneItem}"
                                           itemLabel="#{escursioneItem.descrizione.toString()}"
                                           />

                        </p:selectOneMenu>

                        <p:outputLabel value="#{myBundle.CreateElementoLabel_camera}" for="camera" />
                        <p:selectOneMenu id="camera" value="#{elementoController.selected.camera}"  converter="cameraConverter">
                            <f:selectItem itemLabel="#{myBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{cameraController.items}"
                                           var="cameraItem"
                                           itemValue="#{cameraItem}"
                                           itemLabel="#{cameraItem.descrizione.toString()}"
                                           />

                        </p:selectOneMenu>

                        <p:outputLabel value="#{myBundle.CreateElementoLabel_volo}" for="volo" />
                        <p:selectOneMenu id="volo" value="#{elementoController.selected.volo}"  converter="voloConverter">
                            <f:selectItem itemLabel="#{myBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{voloController.items}"
                                           var="voloItem"
                                           itemValue="#{voloItem}"
                                           itemLabel="#{voloItem.idVOLO.toString()}"
                                           />

                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{elementoController.saveNew}" value="#{myBundle.Save}" update="display,:ElementoListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,ElementoCreateDialog);"/>
                    <p:commandButton value="#{myBundle.Cancel}" onclick="ElementoCreateDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
